//
//  FortuneLabelCell.m
//  SmileWeather
//
//  Created by 范琦 on 15/9/20.
//  Copyright (c) 2015年 陶天海. All rights reserved.
//

#import "FortuneLabelCell.h"

@implementation FortuneLabelCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setCell];
    }
    return self;
}
- (void)setModel:(FortuneDetailModel *)model{
    
    self.imageZH.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.png",[model.total description]]];
    self.imageLove.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.png",[model.love description]]];
    self.imageWork.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.png",[model.work description]]];
    self.imageMoney.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.png",[model.money description]]];

    self.labelSP.text = [NSString stringWithFormat:@"速配星座  %@",model.match];
    self.labelSP.font = [UIFont systemFontOfSize:14];
    self.labelSP.textColor = [UIColor whiteColor];
    
    self.labelXY.text = [NSString stringWithFormat:@"幸运数字  %@",model.number];
    self.labelXY.font = [UIFont systemFontOfSize:14];
    self.labelXY.textColor = [UIColor whiteColor];
    
    self.labelColor.text = [NSString stringWithFormat:@"幸运颜色  %@",model.color];
    self.labelColor.font = [UIFont systemFontOfSize:14];
    self.labelColor.textColor = [UIColor whiteColor];
    
    self.labelST.text = [NSString stringWithFormat:@"商谈指数  %@",model.business];
    self.labelST.font = [UIFont systemFontOfSize:14];
    self.labelST.textColor = [UIColor whiteColor];
    
    self.labelHeath.text = [NSString stringWithFormat:@"健康指数  %@",model.health];
    self.labelHeath.font = [UIFont systemFontOfSize:14];
    self.labelHeath.textColor = [UIColor whiteColor];
}

- (void)setCell{
    self.labelZH = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, kWidth / 5, 20)];
    [self.contentView addSubview:self.labelZH];
    self.labelZH.text = @"综合运势";
    self.labelZH.textColor = [UIColor whiteColor];
    self.labelZH.font = [UIFont systemFontOfSize:14];
    
    self.labelLove = [[UILabel alloc]initWithFrame:CGRectMake(self.labelZH.frame.origin.x, self.labelZH.bounds.size.height + 15, kWidth / 5, 20)];
    [self.contentView addSubview:self.labelLove];
    self.labelLove.text = @"爱情运势";
    self.labelLove.textColor = [UIColor whiteColor];
    self.labelLove.font = [UIFont systemFontOfSize:14];
    
    
    
    self.labelWork = [[UILabel alloc]initWithFrame:CGRectMake(self.labelZH.frame.origin.x, self.labelLove.frame.origin.y + self.labelLove.bounds.size.height + 15, kWidth / 5, 20)];
    [self.contentView addSubview:self.labelWork];
    self.labelWork.text = @"工作状况";
    self.labelWork.textColor = [UIColor whiteColor];
    self.labelWork.font = [UIFont systemFontOfSize:14];
    
    
    
    self.labelMoney = [[UILabel alloc]initWithFrame:CGRectMake(self.labelZH.frame.origin.x, self.labelWork.frame.origin.y + self.labelWork.bounds.size.height + 15, kWidth / 5, 20)];
    [self.contentView addSubview:self.labelMoney];
    self.labelMoney.text = @"理财投资";
    self.labelMoney.textColor = [UIColor whiteColor];
    self.labelMoney.font = [UIFont systemFontOfSize:14];
    
    
    
    self.labelSP = [[UILabel alloc]initWithFrame:CGRectMake(self.labelZH.frame.origin.x, self.labelMoney.frame.origin.y + self.labelMoney.bounds.size.height + 15, kWidth / 2.5, 20)];
    [self.contentView addSubview:self.labelSP];
    self.labelSP.textColor = [UIColor whiteColor];
    self.labelSP.font = [UIFont systemFontOfSize:14];
    
    self.imageZH = [[UIImageView alloc]initWithFrame:CGRectMake(self.labelZH.bounds.size.width + 20, self.labelZH.frame.origin.y, kWidth / 4, 20)];
    [self addSubview:self.imageZH];
    
    self.imageLove = [[UIImageView alloc]initWithFrame:CGRectMake(self.labelLove.bounds.size.width + 20, self.labelLove.frame.origin.y, kWidth / 4, 20)];
    [self addSubview:self.imageLove];
    
    self.imageWork = [[UIImageView alloc]initWithFrame:CGRectMake(self.labelWork.bounds.size.width + 20, self.labelWork.frame.origin.y, kWidth / 4, 20)];
    [self addSubview:self.imageWork];
    
    self.imageMoney = [[UIImageView alloc]initWithFrame:CGRectMake(self.labelMoney.bounds.size.width + 20, self.labelMoney.frame.origin.y, kWidth / 4, 20)];
    [self addSubview:self.imageMoney];
    
    
    self.labelXY = [[UILabel alloc]initWithFrame:CGRectMake(self.imageZH.frame.origin.x + self.imageZH.bounds.size.width + 20, self.labelZH.frame.origin.y, kWidth / 3 + 10, 20)];
    [self addSubview:self.labelXY];
    
    self.labelColor = [[UILabel alloc]initWithFrame:CGRectMake(self.labelXY.frame.origin.x, self.labelLove.frame.origin.y, kWidth / 3 + 10, 20)];
    [self addSubview:self.labelColor];
    
    self.labelST = [[UILabel alloc]initWithFrame:CGRectMake(self.labelXY.frame.origin.x, self.labelWork.frame.origin.y, kWidth / 3 + 10, 20)];
    [self addSubview:self.labelST];
    
    self.labelHeath = [[UILabel alloc]initWithFrame:CGRectMake(self.labelXY.frame.origin.x, self.labelMoney.frame.origin.y, kWidth / 3 + 10, 20)];
    [self addSubview:self.labelHeath];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
